<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<div id="app">
  <!-- 1.选择一个 -->
  <h2>选择一种水果</h2>
  <label for="fruitSelect"></label>
  <select id="fruitSelect" name="fruitSelect" v-model="fruit">
    <option value="苹果">苹果</option>
    <option value="香蕉">香蕉</option>
    <option value="榴莲">榴莲</option>
    <option value="葡萄">葡萄</option>
  </select>
  <h2>您选择的水果是: {{fruit}}</h2>
  <br>
  <!-- 2.选择多个 -->
  <h2>选择任何您喜欢的水果</h2>
  <label for="fruitsSelect"></label>
  <select id="fruitsSelect" multiple name="fruitsSelect" v-model="fruits">
    <option value="苹果">苹果</option>
    <option value="香蕉">香蕉</option>
    <option value="榴莲">榴莲</option>
    <option value="葡萄">葡萄</option>
  </select>
  <h2>您选择的水果是: {{fruits}}</h2>
  <br>
  <!-- 3.绑定通过v-for生成的选单 -->
  <h2>选择任何您喜欢的水果</h2>
  <label for="vForFruitsSelect"></label>
  <select id="vForFruitsSelect" multiple name="vForFruitsSelect" v-model="vForFruits">
    <option v-bind:value="item" v-for="item in allFruits">{{item}}</option>
  </select>
  <h2>您选择的水果是: {{vForFruits}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      fruit: '香蕉',
      fruits: ['香蕉'],
      vForFruits: ['香蕉'],
      allFruits: ['香蕉', '苹果', '榴莲', '西瓜', '菠萝', '火龙果', '柳橙', '樱桃']
    }
  })
</script>

</body>
</html>